<template>
  <el-row :gutter="20">
    <el-col :xs="9" :sm="9" :md="9" :lg="9" :xl="5">
      <el-card align="middle" :body-style="siteContentViewHeight">
        <el-input
          style="width: 190px"
          clearable
          v-model="input"
          placeholder="请输入内容"
        ></el-input>
        <el-button type="danger" @click="getDataList()">搜索</el-button>
        <!-- 树形控件数据 -->
        <coreorgtree
          class="organTree"
          :style="{
            height: scrollerHeight,
            overflow: 'auto',
          }"
          ref="coreorg"
        ></coreorgtree>
      </el-card>
    </el-col>
    <el-col :xs="15" :sm="15" :md="15" :lg="15" :xl="19">
      <el-card align="middle" :body-style="siteContentViewHeight">
        <el-container>
          <el-header><H4 style="float: left">日志列表</H4></el-header>
          <el-main> </el-main>
        </el-container>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
import coreorgtree from "@/views/common/CoreOrgtree.vue";
import { isURL } from "@/utils/validate";

export default {

  components: {
    coreorgtree,
  },
  data() {
    return {
      input: "",
    };
  },

  computed: {
    scrollerHeight() {
      return window.innerHeight - 200 + "px";
    },
    documentClientHeight: {
      get() {
        return this.$store.state.common.documentClientHeight;
      },
    },
    siteContentViewHeight() {
      var height = this.documentClientHeight - 100 - 30 - 2;
      if (this.$route.meta.isTab) {
        height -= 40;
        return isURL(this.$route.meta.iframeUrl)
          ? { height: height + "px" }
          : { maxHeight: height + "px", minHeight: height + "px" };
      }
      return { maxHeight: height + "px", minHeight: height + "px" };
    },
  },

  mounted() {},

  methods: {
    getDataList(){
      this.$refs.coreorg.getcoreorg(this.input)
    }
  },
};
</script>

<style lang="scss" scoped>
.organTree::-webkit-scrollbar {
  display: none;
}
.grid-content {
  background: #d3dce6;
}
</style>